UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xby0N73njfbIbiW6mNTqaO2jI+7KdnHA/M056hjj+UQ='
WHERE
key_id = '4c82d2fcc7c98c0518070d9acaae3e2893dd368f0c62ddd104f26333e6dec71b'
AND (
token = 'Xby0N73njfbIbiW6mNTqaO2jI+7KdnHA/M056hjj+UQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)