UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vO6PS0hwGwvt6UNTvvcMSY8B5DlBVjTXsi1KzyW1HKI='
WHERE
key_id = '5fc7761134c47c622ec194022e995244e0236d1147b71606f89840c81b39cfd1'
AND (
token = 'vO6PS0hwGwvt6UNTvvcMSY8B5DlBVjTXsi1KzyW1HKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)