UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O0KzPru2fa+Po8FZlfuoYB861E8XxQEmAzNRwqJQjVI='
WHERE
key_id = '088b2a62d7d65a61e0fa9ce8b9e571a5db6e6437267e93482b0e6b64cec0aaa6'
AND (
token = 'O0KzPru2fa+Po8FZlfuoYB861E8XxQEmAzNRwqJQjVI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)