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