UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X3RY7l+VxAQI65pVfNrHrVK3qh6/kpkNNUDokJBLfwQ='
WHERE
key_id = 'b0edaf10b96936af6dc21fa6c7a13e370abaa774306e37458d969143a07b172c'
AND (
token = 'X3RY7l+VxAQI65pVfNrHrVK3qh6/kpkNNUDokJBLfwQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)