UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'it0mXTL6tq2fC32Gx5QXXAQf0Gu0w9RCxUq5umUwJkI=' 
WHERE 
  key_id = '10959532b9273846abb14585f66dceec086b21cf2bb60ac245526f10a65b2d7c' 
  AND (
    token = 'it0mXTL6tq2fC32Gx5QXXAQf0Gu0w9RCxUq5umUwJkI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029