UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bw5MW4jo8DCsgfapvRJ4E9WVEB43/bovXU95hGu5qoc=' 
WHERE 
  key_id = '1cf0e2c0b323934c81495b9313b676453028b5e24cc530620a7cb3c6d8d7e8b5' 
  AND (
    token = 'Bw5MW4jo8DCsgfapvRJ4E9WVEB43/bovXU95hGu5qoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020