UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eUMfTSUzV1oJTSrSwc3usr2sZhNI1aoqSg7gp2qGcW4='
WHERE
key_id = '533f54f8b19b3531bc0a913af0809cd3e88de6b0e0b5383ed85d0fc5775c56e0'
AND (
token = 'eUMfTSUzV1oJTSrSwc3usr2sZhNI1aoqSg7gp2qGcW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)