UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q/58K5mhRmA4s1p2jFLtJU9DLnIp43/X8PREH4uA3KU='
WHERE
key_id = 'bb44af92c5827cdbd18ce462fa6d40a0773ab8009e4dce98b4dc08eb9280a3f8'
AND (
token = 'Q/58K5mhRmA4s1p2jFLtJU9DLnIp43/X8PREH4uA3KU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)