UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a63P0hV9YrX/NOPHyZE9QeWiXTjPFqbGL81LS1fCyTU='
WHERE
key_id = '4a092f7195fbe069372916a7271c6ed4d4c32a7b8de2760a03eb56a06c9b7813'
AND (
token = 'a63P0hV9YrX/NOPHyZE9QeWiXTjPFqbGL81LS1fCyTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)