UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CzPgmsrncwhg8oJS9Cr6j/xRfsajizpIByxg6sAeZ8w='
WHERE
key_id = 'e269886072cd977bb5f0f6ad3dfa631942036048fa999f74cef14ddbfd19e339'
AND (
token = 'CzPgmsrncwhg8oJS9Cr6j/xRfsajizpIByxg6sAeZ8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)