UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fa711G7CqUdCsNgOIMP7a5ba0eYhC+EuouteeadluHs='
WHERE
key_id = 'db695060844557ef408ab2c32bc3deb7f3a606cb70ff4d44ff901684d43c70d3'
AND (
token = 'Fa711G7CqUdCsNgOIMP7a5ba0eYhC+EuouteeadluHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)