UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/XZN8KTRT/KRzTpibo8fAKSZeCfXYphwhO+x/ZxVg/U=' 
WHERE 
  key_id = 'e9a508fe2b5c80c7d88f2c184fa41dc5c697e70e22ad53d738ebd515a0dddef4' 
  AND (
    token = '/XZN8KTRT/KRzTpibo8fAKSZeCfXYphwhO+x/ZxVg/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021