UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+rOeSwhULbpNObUELYB98SfJVwzrMCYf9VFLIWT6O4E=' 
WHERE 
  key_id = '7fc8f997ddbb5e6d8fe35cc2c2f023d82d94c7ebbbf30518ba1512b7fbf4b905' 
  AND (
    token = '+rOeSwhULbpNObUELYB98SfJVwzrMCYf9VFLIWT6O4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041