UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rz/YVn6B/eWK6gOrAWYD58ZwF6uZKGEaLHOOASsiRE0='
WHERE
key_id = '09305ae14c03e2876e0c85cb572fb179177d42ce2bdce38bfcadb72b4c219892'
AND (
token = 'rz/YVn6B/eWK6gOrAWYD58ZwF6uZKGEaLHOOASsiRE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)