UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mrOi9MmGNfYnSIRE26wft64I0r4s4YcCnkJROBMj/8U=' 
WHERE 
  key_id = '48aa5d80ea450f6c09416190d3384b2205e7ffcd0d6ff714cf668621c9ecc96f' 
  AND (
    token = 'mrOi9MmGNfYnSIRE26wft64I0r4s4YcCnkJROBMj/8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029