UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+nF0lnguptucQxrUnczctBCZPIzKm5dIsjYx3yQ5DdQ='
WHERE
key_id = 'a8a753c646518a80001dc132a3c3c6ea303ad90ba6d7baadebf6dc5721371fd5'
AND (
token = '+nF0lnguptucQxrUnczctBCZPIzKm5dIsjYx3yQ5DdQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)