UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DU8FUcWZDQU05+lCmkvZeyHAeNffbAbRnl4ldNnQpz4=' 
WHERE 
  key_id = '3e7b15f3341863774e00fdc6e2ba181bf3a86a569067d9f095c922f6e80871e8' 
  AND (
    token = 'DU8FUcWZDQU05+lCmkvZeyHAeNffbAbRnl4ldNnQpz4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038