UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X9mz3N+FKXlSNDKDkmu99X3gX5TWvdHRngzLWKgnNUo='
WHERE
key_id = 'c6b0c8993592c4bd2c2c151c94939c27a2231bc2f60fce98ae43e805332eba3d'
AND (
token = 'X9mz3N+FKXlSNDKDkmu99X3gX5TWvdHRngzLWKgnNUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)