UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oUDJYwEystTE55DEdz3OwTTfiyRgZegmehgrL+VqUvs='
WHERE
key_id = '5ad3174d6b6123a87cd6a3827c5a3116c9eb51fb9003e501c108ba0c6e8023fa'
AND (
token = 'oUDJYwEystTE55DEdz3OwTTfiyRgZegmehgrL+VqUvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)