UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AVjkscDkUI0c5vKdBZhoG488ncil+OubMEaTLcO9FaA='
WHERE
key_id = 'd8189a0b655f6286bf2c5e5c28b13731285a418ef74c84aabf7c327434ca3dbb'
AND (
token = 'AVjkscDkUI0c5vKdBZhoG488ncil+OubMEaTLcO9FaA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)