UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ojq04r1huGNeR0a7lUjOpqqOp1LLVRgKfPWm0RPPZ1Y=' 
WHERE 
  key_id = '81d0a098c563131127ebf0d359dbdab960ba0292155e29d693833582d091528b' 
  AND (
    token = 'Ojq04r1huGNeR0a7lUjOpqqOp1LLVRgKfPWm0RPPZ1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029