UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FHLyPY8Aa7qKtdyiKpj0+2i3y1Aq8DBUk2NZWMwJT/c=' 
WHERE 
  key_id = '378d80de1ccdb02654eafca8250d97ce88df8f5d988562d35b2b974a7c078f76' 
  AND (
    token = 'FHLyPY8Aa7qKtdyiKpj0+2i3y1Aq8DBUk2NZWMwJT/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036