UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WCK7oGALu58GZNmgOiyxpzqcCCXVAcZCgXkWV8wo7Xs=' 
WHERE 
  key_id = '1b0b6c4efb93d1ab1ad821c0b2d1a3b6682b439301a53d192035505bc9416d48' 
  AND (
    token = 'WCK7oGALu58GZNmgOiyxpzqcCCXVAcZCgXkWV8wo7Xs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018