UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rCkSxXgaVSbEOahFWsRNVOxHDua8xt6EgSe4B/99DWQ=' 
WHERE 
  key_id = 'c6233737338b6fb92d63bc9e7f6f2bda96f512e52cc058e703c10477b2ab28f1' 
  AND (
    token = 'rCkSxXgaVSbEOahFWsRNVOxHDua8xt6EgSe4B/99DWQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029