UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PDnF1JLaYvEyLBLsl7+qCXjZSdX/XP0pQ/xQjpjpCIM='
WHERE
key_id = '3e10754b0659effc8f4e0ea3e27eea2b75de9299283498054ebc85fc394f2f2a'
AND (
token = 'PDnF1JLaYvEyLBLsl7+qCXjZSdX/XP0pQ/xQjpjpCIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)