UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q9A/xc54TG78BXJ19Od0fBvLKT4raOdkNY1jjuDzZBk='
WHERE
key_id = 'ff7508a933bc8e691530bb67c324d41567e492eb7c3aabe132e0f6a10bc8edad'
AND (
token = 'Q9A/xc54TG78BXJ19Od0fBvLKT4raOdkNY1jjuDzZBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)