UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xZgbtuUyGYxyfuEDbIViAiRkRPHsvoKml7gySKzehtI='
WHERE
key_id = 'df608b3d557ceb69b3ffe3ef0ae6160d9be75e0a766d1add27f7755cf9e201b1'
AND (
token = 'xZgbtuUyGYxyfuEDbIViAiRkRPHsvoKml7gySKzehtI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)