UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/pgj5sjh7KQNcEBCXiDxcGtX33i20GVkyi8WxyqTV4s='
WHERE
key_id = '461aa3244d7b7ca3cc285232585e22a0125acb45934b2ef45da7c3c7cce69fb0'
AND (
token = '/pgj5sjh7KQNcEBCXiDxcGtX33i20GVkyi8WxyqTV4s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)