UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gfECSbv5Qf2BXr0Bh7aH5ZZG3WgHHNRGWJNMD+ZXebY=' 
WHERE 
  key_id = 'fdccbaced91ad907d64f197edcf38b459c4acbf856e9b130c75ae60237ddf3e9' 
  AND (
    token = 'gfECSbv5Qf2BXr0Bh7aH5ZZG3WgHHNRGWJNMD+ZXebY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030