UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wCqxK7bKJmYzHOT9DR8PjA11KhOXDB+2H/zHMijpzng=' 
WHERE 
  key_id = '6bc681b1c48c563cba996a9e19ea1c556420182a84941f649469e929bdd20b7c' 
  AND (
    token = 'wCqxK7bKJmYzHOT9DR8PjA11KhOXDB+2H/zHMijpzng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027