UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bA9HwYVMJ/rG0hoo2QeaNzrBeAkOj0DTcPvnNj7HA8='
WHERE
key_id = 'ce738e2b70d4adb2302ff24839d49e7fcda8919d25d03e54511839f3de588d5d'
AND (
token = '1bA9HwYVMJ/rG0hoo2QeaNzrBeAkOj0DTcPvnNj7HA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)