UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mvgQw4H1hblIDxxKy8nOwnMdxuA9B9soXwyByKBh8sI=' 
WHERE 
  key_id = 'c112a34cb32795460f112b04f6ec80dbcca26e596dbcace776db2536a4a07f8a' 
  AND (
    token = 'mvgQw4H1hblIDxxKy8nOwnMdxuA9B9soXwyByKBh8sI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038