UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jYmTuoFipbNVfEDOrd5GNSQenrhjpjPz0HlH8Rbf7Ig='
WHERE
key_id = '6f90ee8365c95c396df53c1f7eaf960e8af7533e73c22218bd6d30a42be8d739'
AND (
token = 'jYmTuoFipbNVfEDOrd5GNSQenrhjpjPz0HlH8Rbf7Ig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)