UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HH0Qnt5ZYVqsfPbxVSMM/YlX8H2COkoNudr/4BeLTro=' 
WHERE 
  key_id = 'ee31775fc742b1a9e70da09a64437e2dbbb22c141f2e202d6d19b74776ae0dda' 
  AND (
    token = 'HH0Qnt5ZYVqsfPbxVSMM/YlX8H2COkoNudr/4BeLTro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036